// pages/mine/certification/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
	  certigication:[
		  { img: "/images/renzheng_1.png", name: "车主", isdone: true, txt: "查看档案", url1: "/pages/mine/carfile/index", url2:"/pages/mine/carfile/index"},
		  { img: "/images/renzheng_2.png", name: "商户", isdone: false, txt: "查看店铺", url1: "/pages/mine/mystore/index", url2: "addmerchant" },
		  { img: "/images/renzheng_3.png", name: "城市运营商", isdone: false, txt: "查看运营商", url1: "agent/index", url2: "agent/add" },
		  { img: "/images/renzheng_4.png", name: "销售员", isdone: false, txt: "查看销售员", url1: "addsales", url2: "addsales" }
	  ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  onShow: function () {
	  var temp = this.data.certigication
	  for (var i = 0; i < temp.length; i++) {
		  console.log(temp[i].isdone)
		  if (temp[i].isdone == false) {
			  temp[i].url1 = temp[i].url2
		  }
	  }
	  this.setData({
		  certigication: temp
	  })
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})